package com.zhoukx.netty.doubborpc.customer;

import com.zhoukx.netty.doubborpc.netty.NettyClient;
import com.zhoukx.netty.doubborpc.provider.HelloServiceImpl;
import com.zhoukx.netty.doubborpc.publicinterface.HelloService;

public class ClientBootStrap {


    // 定义协议头
    public  static  final String  PROVIDERNAME="HelloService#hello#";

    public static void main(String[] args) throws InterruptedException {
        NettyClient nettyClient = new NettyClient();
        HelloService bean = (HelloService) nettyClient.getBean(HelloService.class, PROVIDERNAME);
        for (;;){
            Thread.sleep(2*1000);
            // 通过代理对象调用服务提供者的方法(服务)
            String hello = bean.hello("你好  bubbo~");
            System.out.println("调用的结果 res = " + hello);
        }

    }
}
